
const state = {
    count: 2
}
const mutations = {
    SET_COUNT(state, num) {
        state.count = num;
    }
}
const actions = {
    changeCount({ commit }, num) {
        commit('SET_COUNT', num)
    }
}
const getters = {
    newCount(state) {
        return state.count * 10
    }
}

export default {
    namespaced: true, // 开启命名空间
    state,
    mutations,
    actions,
    getters,
}